package logic;

import java.text.Collator;
import java.util.Locale;
import java.util.Date;


public class Realty implements Comparable<Realty>{
	
	int id;
	
	String title;
	
	String alias;

	String description;
		
	double cost;
	
	String owner;			// in future Object Owner - Person
	
	String negotiator;
	
	int hits;
	
	boolean hot;
	
	boolean sold;
	
	String created;			// in future Object Created - Person-Worker
	
	Date createdDate;
	
	String modified;		// in future Object Modified - Person-Worker
	
	Date modifiedDate;
	
	String published;		// in future Object Published - Person-Worker
	
	Date publishedDateUp;
	
	Date publishedDateDown;
	
	Realty()
	{}


	@Override
	public int compareTo(Realty that) {
		Collator collator = Collator.getInstance(new Locale("ru"));
		collator.setStrength(Collator.PRIMARY);
		return collator.compare(this.toString(), that.toString());
	}
	
	@Override
	public String toString(){
		return "ID [" + id + "], title[" + title + "], cost["+ cost + "],  created date["+ createdDate +"]";
	}
	
}
